#include<cstdio>
#include<iostream>
using namespace std;
int n,L,R,now,ans;
int main()
{
	freopen("candy.in","r",stdin);
	freopen("candy.out","w",stdout);
	scanf("%d%d%d",&n,&L,&R);
	while(R>L)
	{
		now=L;
		if(L%n==0) now+=n-1;
		else now=((L/n)+1)*n-1;
		if(now>R) now=R;
		ans+=now%n;
		R-=now;
	}
	printf("%d",ans);
	fclose(stdin);
	fclose(stdout);
}
